<link href="__CDN__/assets/addons/kuerp/css/common.css?v={$Think.config.site.version}" rel="stylesheet">

<style type="text/css">
	.btn-list {
		position: fixed;
		right: 40px;
	}
	.div-flex {
		display: flex
	}
	.div-flex .form-group {
		margin-right: 50px;
		text-align: center;
		line-height: 25px;
		margin-bottom: 0;
	}
	.tab-pane {
		border: 1px solid #F6F6F6;
	}
	.i-color {
		font-size: 34px;margin-right: 10px;color: #86C3FF;
	}
	.thumbnail {
		display: flow-root;
		width: max-content;
	}
	.thumbnail img {
		width: 50px;
		float: left;
		padding: 5px;
	}

</style>
{include file="kuerp/common/menu" /}
<div class="panel panel-default panel-intro">
	<input type="hidden" name="ids" id="ids" value="{$ids}"/>
	<div>
		<div class="div-flex">
			<i class="fa fa-address-card i-color"></i>
			<div style="line-height: 35px;"><b>{$row.customer_name}</b>
				{if condition="$row.lat"}
				<a style="color: #4397fd" href="https://apis.map.qq.com/uri/v1/marker?marker=coord:{$row.lat},{$row.lng};title:{$row.customer_name};addr:{$row.address}&referer=crm" target="_blank" ><i class="fa fa-map-marker text-blue" style="font-size: 18px;margin-right:4px"></i>{$row.address}</a> 
				{/if}
			</div>
				{if condition="$row.operation == 'update'"}
			<div class="btn-list">
				{if condition="($row.operation_team == 'update') or $row.operation == 'update'"}
				<a class="btn btn-success btn-edit {:$auth->check('kuerp/customers/edit')?'':'hide'}"  >编辑</a>
				{/if}
				{if condition="$row.operation_team == 'read'"}
				{neq name="row.staff_member_id" value="0"}
				<a class="btn btn-success btn-change {:$auth->check('kuerp/customers/changestaff')?'':'hide'}">转移</a>
				<a href="javascript:void(0)"
				   class="btn btn-danger btn-del {:$auth->check('kuerp/customers/del')?'':'hide'}" >删除</a>
				{/neq}
				{/if}
			</div>
			{/if}
		</div>
		<div class="div-flex" style="margin-top: 20px;margin-bottom: 20px">
			<div class="form-group">
				<span class="text-muted">客户类别</span>
				<p>{$row.customertype.type_name}</p>
			</div>
			<div class="form-group">
				<span class="text-muted">客户等级</span>
				<p>{$row.customerlevel.name}</p>
			</div>
			<div class="form-group">
				<span class="text-muted">跟进状态</span>
				<p>{$row.follow_status}</p>
			</div>
			<div class="form-group">
				<span class="text-muted">销售人员</span>
				<p>{$row.saler.name}</p>
			</div>
			<div class="form-group">
				<span class="text-muted">创建时间</span>
				<p>{$row.createtime}</p>
			</div>
		</div>
	</div>
	<div>
		<ul class="nav nav-tabs" role="tablist">
			<li role="presentation" class="active"><a href="#basic" aria-controls="profile" role="tab" data-toggle="tab">基本信息</a></li>
			<li role="presentation"><a href="#record" aria-controls="home" role="tab" data-toggle="tab">跟进记录</a></li>
			<li role="presentation"><a href="#contacts" aria-controls="messages" role="tab" data-toggle="tab">联系人</a></li>
<!--			<li role="presentation"><a href="#settings7" aria-controls="settings" role="tab" data-toggle="tab">商机</a></li>-->
<!--			<li role="presentation"><a href="#quote" aria-controls="messages" role="tab" data-toggle="tab">报价记录</a></li>-->
<!--			<li role="presentation"><a href="#product" aria-controls="messages" role="tab" data-toggle="tab">客户产品</a></li>-->
			<li role="presentation"><a href="#settings1" aria-controls="settings" role="tab" data-toggle="tab">订单</a></li>
<!--			<li role="presentation"><a href="#settings5" aria-controls="settings" role="tab" data-toggle="tab">费用</a></li>-->
			<li role="presentation"><a href="#settings2" aria-controls="settings" role="tab" data-toggle="tab">回款信息</a></li>
<!--			<li role="presentation"><a href="#settings3" aria-controls="settings" role="tab" data-toggle="tab">附件</a></li>-->
			<li role="presentation"><a href="#settings6" aria-controls="settings" role="tab" data-toggle="tab">签到记录</a></li>
			<li role="presentation"><a href="#settings4" aria-controls="settings" role="tab" data-toggle="tab">操作记录</a></li>
		</ul>
		<div class="tab-content" style="overflow-y: scroll;min-height:565px">
			<div role="tabpanel" class="tab-pane fade panel-body form-horizontal active in" id="basic">
				<div class="form-group">
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">客户名称:</span>
							<span class="text-black">{$row.customer_name}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">客户类别:</span>
							<span class="text-black">{$row.customertype.type_name}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">客户等级:</span>
							<span class="text-black">{$row.customerlevel.name}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">客户编号:</span>
							<span class="text-black">{$row.customer_code}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">销售人员:</span>
							<span class="text-black">{$row.saler.name}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">联系人:</span>
							<span class="text-black">{$row.connet_name}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">客户手机:</span>
							<span class="text-black">{$row.customer_mobile}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">地区:</span>
							<span class="text-black">{$row.mergename}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">详细地址:</span>
							<span class="text-black">{$row.address}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">房号:</span>
							<span class="text-black">{$row.room}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">期初应收款:</span>
							<span class="text-black">{$row.receive_account}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">期初预收款:</span>
							<span class="text-black">{$row.opening_prepayment}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">纳税人识别号:</span>
							<span class="text-black">{$row.identification}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">开户银行:</span>
							<span class="text-black">{$row.deposit_bank}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">银行账号:</span>
							<span class="text-black">{$row.bank_number}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">银行账号:</span>
							<span class="text-black">{$row.bank_number}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">协作人:</span>
							<span class="text-black">{$row.collaborator}</span>
						</div>
					</div>
					<div class="col-xs-6 col-sm-5">
						<div class="form-group col-sm-10">
							<span class="text-muted">备注:</span>
							<span class="text-black">{$row.note}</span>
						</div>
					</div>
				</div>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="record">
				<div id="toolbar_records" class="toolbar">
					{:build_toolbar('refresh')}
					{if condition="$row.operation == 'update'"}
					<a class="btn btn-success btn-dialog {:$auth->check('kuerp/record/add')?'':'hide'}"
					   data-url="kuerp/record/add?customer_id={$row.id}" data-title="新建跟进" data-refresh="true" data-area=["90%","90%"]>新建跟进</a>
					{/if}
				</div>
				<table id="records" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="contacts">
				<div id="toolbar_contacts" class="toolbar">
					{:build_toolbar('refresh')}
					{if condition="$row.operation == 'update'"}
					<a class="btn btn-success btn-dialog {:$auth->check('kuerp/customers_user/add')?'':'hide'}"
					   data-url="kuerp/customers_user/add?customer_id={$row.id}" data-title="新建联系人"  data-refresh="true" data-area=["90%","90%"]>新建联系人</a>
					{/if}
				</div>
				<table id="table-contacts" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="settings7">
				<div id="toolbar_business" class="toolbar">
					{:build_toolbar('refresh')}
					<!-- {if condition="$row.operation == 'update'"}
					<a class="btn btn-success btn-dialog"
					   data-url="kuerp/customers/business/add?customer_id={$row.id}" data-title="新建商机" data-refresh="true" data-area=["90%","90%"]>新建商机</a>
					{/if} -->
				</div>
				<table id="business" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="settings1">

				<div id="toolbar_contract" class="toolbar">
					{:build_toolbar('refresh')}
					{if condition="$row.operation == 'update'"}
					<a class="btn btn-success btn-dialog {:$auth->check('kuerp/goods_sales/add')?'':'hide'}"
					   data-url="kuerp/goods_sales/add?customer_id={$row.id}" data-title="新建订单" data-refresh="true" data-area=["90%","90%"] >新建订单</a>
					{/if}
				</div>
				<table id="contract" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="settings5">

				<div id="toolbar_consume" class="toolbar">
					{:build_toolbar('refresh')}
					{if condition="$row.operation == 'update'"}
					<a class="btn btn-success btn-dialog {:$auth->check('kuerp/customers/consume/add')?'':'hide'}"
					   data-url="kuerp/customers/consume/add?customer_id={$row.id}" data-title="新建费用" data-refresh="true" data-area=["90%","90%"]>新建费用</a>
					{/if}
				</div>
				<table id="consume" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="settings2">
				<div class="panel panel-info">
					<div class="panel-heading">回款记录</div>
					<div class="panel-body">
<!--						<div id="toolbar_receivables" class="toolbar">-->
<!--&lt;!&ndash;							{:build_toolbar('refresh')}&ndash;&gt;-->
<!--&lt;!&ndash;							{if condition="$row.operation == 'update'"}&ndash;&gt;-->
<!--&lt;!&ndash;							<a class="btn btn-success btn-dialog {:$auth->check('kuerp/customers/receivables/add')?'':'hide'}"  data-refresh="true" data-url="kuerp/customers/receivables/add?customer_id={$row.id}" data-area=["90%","90%"] data-title="新建回款">新建回款</a>&ndash;&gt;-->
<!--&lt;!&ndash;							{/if}&ndash;&gt;-->
<!--						</div>-->

						<table id="receivables" class="table table-striped table-bordered table-hover table-nowrap"
							   width="100%">
						</table>
					</div>
				</div>

			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="settings3">
				<div id="toolbar_files" class="toolbar">
					{:build_toolbar('refresh')}
				</div>
				<table id="files" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="team">
				{if condition="$row.operation_team == 'read' && $row.operation == 'update'"}
				<div id="toolbar_team" class="toolbar">
					{:build_toolbar('refresh')}
					<a class="btn btn-info btn-dialog {:$auth->check('kuerp/customers/customer/addteam')?'':'hide'}"
					   data-url="kuerp/customers/customer/addteam?ids={$row.id}" data-title="添加团队成员" data-refresh="true" data-area='["500px","300px"]'  >添加团队成员</a>
				</div>
				<table id="table_team" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
				{/if}
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="settings6">
				<div id="toolbar_sign" class="toolbar">
					{:build_toolbar('refresh')}
				</div>
				<table id="sign" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="settings4">
				<div id="toolbar_log" class="toolbar">
					{:build_toolbar('refresh')}
				</div>
				<table id="operation_log" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>
			<div role="tabpanel" class="tab-pane fade panel-body" id="quote">
				<div id="toolbar_quote" class="toolbar">
					{:build_toolbar('refresh')}
					{if condition="$row.operation == 'update'"}
					<a class="btn btn-success btn-dialog" data-url="kuerp/customers/quote/add?customer_id={$row.id}" data-title="新建报价单"  data-refresh="true" data-area=["90%","90%"]>新建报价单</a>
					{/if}
				</div>
				<table id="table-quote" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>

			<div role="tabpanel" class="tab-pane fade panel-body" id="product">
				<div id="toolbar_product" class="toolbar">
					{:build_toolbar('refresh')}

				</div>
				<table id="table-product" class="table table-striped table-bordered table-hover table-nowrap"
					   width="100%">
				</table>
			</div>


		</div>

	</div>
</div>